def sum_of_multiples(limit: int, multiples: set) -> int:
    result = set()
    for base in multiples:
        if (base > 0):
            value = base
            while (value < limit):
                result.add(value)
                value += base
    return sum(result)

sum_of_multiples(20, {3,5})